﻿ @{
    var currentPath = Context.Request.Path.ToString();
}
<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>@ViewBag.Title</title>
    <link rel="stylesheet" href="~/Static/component/pear/css/pear.css" />
    <!-- 自动引入对于页面的css -->
    @if (!string.IsNullOrWhiteSpace(currentPath))
    {
        var cssHref = $"~/Static/Assets/Styles{currentPath}.css";
        if (File.Exists(System.IO.Path.GetFullPath(cssHref.Replace("~", "wwwroot"))))
        {
            <link rel="stylesheet" href="@cssHref" asp-append-version=true />
        }
    }
    @await RenderSectionAsync("Styles", required: false)
</head>
<body class="pear-container">
    @RenderBody()
    <div id="extraContainer"></div>
    <script src="~/Static/component/layui/layui.js"></script>
    <script src="~/Static/component/pear/pear.js"></script>
    <!-- 自动引入对于页面的js -->
    @if (!string.IsNullOrWhiteSpace(currentPath))
    {
        var jsSrc = $"~/Static/Assets/Scripts{currentPath}.js";
        if (File.Exists(System.IO.Path.GetFullPath(jsSrc.Replace("~", "wwwroot"))))
        {
            <script src="@jsSrc" asp-append-version=true></script>
        }
    }
    @await RenderSectionAsync("Scripts", required: false)
</body>
</html>
